from playwright.sync_api import sync_playwright

def run():
    with sync_playwright() as p:
        # 启动浏览器并访问网页
        browser = p.chromium.launch(headless=False)
        page = browser.new_page()
        page.goto("https://example.com")

        # 保存全屏截图（自动等待页面加载完成）
        page.screenshot(path="example.png", full_page=True)
        print("页面标题:", page.title())  # 输出：Example Domain

        browser.close()

if __name__ == "__main__":
    run()


playwright codegen https://emsp-test.eiceducation.com.cn/admin/